home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
W95 Shareware Collection
/
W95 Collection - Windows 95 Shareware (LCDCAN).iso
/
win95
/
security
/
netlock
/
locktest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-28
|
941b
|
39 lines
#include <stdio.h>
#include "netlock.h"
#define LICENCE_ID 123456
main()
{
int count;
int ret;
long protocols;
char current_licence_user[25];
// We want to use all available protocols
protocols=USE_ALL;
ret=register_licence(LICENCE_ID,&protocols,current_licence_user,0);
if (ret==1)
{
printf("Computer %s is already using the licence!, exiting ..\n",current_licence_user);
return(0);
}
printf("Now i am owner of licence NR %d \n",LICENCE_ID);
for (count=0;count <500;count++)
{
printf("Now doing my normal application work ...\n");
Sleep(2000);
}
// Now let's free the 'locked licence'
// This is not a must, bacause the licence is automatically freed,
// once the program has terminated.
register_licence(0,&protocols,current_licence_user,0);
printf("Freeing licence and exiting ...\n");
return(1);
}